package fem2.gui;

import fem2.gui.pm.HofemPipelineFactory;
import inf.vtk.pm.PipelineCollection;
import inf.vtk.pm.SolidElementsPipeline;
import inf.vtk.pm.uiswing.SolidElementResultsPanel;

import java.awt.BorderLayout;

import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

public class ResultsPanel extends JPanel {

	private static final long serialVersionUID = 1L;

	public ResultsPanel(PipelineCollection pipelineCollection) {
		JTabbedPane tp = new JTabbedPane();
		EdgeResultsPanel erp = new EdgeResultsPanel(pipelineCollection);

		SolidElementResultsPanel serp = new SolidElementResultsPanel(
				(SolidElementsPipeline) pipelineCollection
						.getPart(HofemPipelineFactory.PL_FACES));

		serp.setOutlinesWithWarp(true);

		setLayout(new BorderLayout());
		setBorder(BorderFactory.createTitledBorder("Results"));

		tp.addTab("Edges", erp);
		tp.addTab("Faces", serp);

		add(tp, BorderLayout.NORTH);
		add(new DisplacementPanel(pipelineCollection), BorderLayout.CENTER);
	}
}
